package lp2.projeto;

import java.util.ArrayList;
import java.util.List;

public class Usuario {

	private String nome;
	private List<Integer> opnioes;
	private String dataEHora;
	
	public Usuario(String nome, List<Integer> opinioes, String dataEHora) {
		opnioes = new ArrayList<Integer>();
		if(nome.equals("")){
			nome = "Anomimo";
		}
		this.nome = nome;
		this.dataEHora = dataEHora;
	}

	public String getNome() {
		return nome;
	}

	public List<Integer> getOpnioes() {
		return opnioes;
	}

	public String getDataEHora() {
		return dataEHora;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((dataEHora == null) ? 0 : dataEHora.hashCode());
		result = prime * result + ((nome == null) ? 0 : nome.hashCode());
		result = prime * result + ((opnioes == null) ? 0 : opnioes.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Usuario other = (Usuario) obj;
		if (dataEHora == null) {
			if (other.dataEHora != null)
				return false;
		} else if (!dataEHora.equals(other.dataEHora))
			return false;
		if (nome == null) {
			if (other.nome != null)
				return false;
		} else if (!nome.equals(other.nome))
			return false;
		if (opnioes == null) {
			if (other.opnioes != null)
				return false;
		} else if (!opnioes.equals(other.opnioes))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "nome: " + nome + ", opnioes: " + opnioes
				+ ", dataEHora: " + dataEHora ;
	}
	
	
		

	
}
